import Login from '@/page/Login'
import Article from '@/page/Article'
import App from '../App'
import Layout from '@/page/Layout'
import About from '@/page/About'
import Board from '@/page/Board'
import NotFound from '@/page/404'
import { createBrowserRouter } from 'react-router-dom'
//创建router实例对象
const router = createBrowserRouter([
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        path: 'about',
        element: <About />
      },
      {
        path: 'board',
        element: <Board />
      }
    ]
  },
  {
    path: '/login',
    element: <Login />
  },
  {
    path: '/article/:id/:name',
    element: <Article />
  },
  {
    path: '*',
    element: <NotFound />
  }
])
export default router
